package control;

import java.util.ArrayList;

import store.TaxCalculator;

import model.Treat;

public class KitchenStation extends Station {

	
	String[] actions = {"View Treats", "Make Treat", "Quit"};
	       
	       
	public KitchenStation(ArrayList<Treat> treats, TaxCalculator calc) {
		super(treats, calc);
	}

	protected void interactWithUser(int choice) throws Exception{
		
		if (treats.size() == 0)
			System.out.println("There are no treats currently in the system, buddy.");
		else if(choice == 0)
			viewTreats();
		else 
			makeATreat();
	}

	private void makeATreat() {
		ArrayList<String> treatNames = new ArrayList<String>();
		for (Treat treat: treats)
			treatNames.add(treat.getName());
		int treatToMake = Menu.getMenuOption("Which treat would you like to make, friend?", treatNames);
		System.out.println(treats.get(treatToMake).prepareIngredients());
		if (Menu.yesOrNoMenu("Would you like to mark this treat as made and remove it from the system, pal?"))
			treats.remove(treatToMake);
	}

	private void viewTreats() {
		System.out.println("Here are all the treats in the system, bud");
		for (Treat treat: treats){
			System.out.println(treat.getName());
		}
	}

	@Override
	String[] getActions() {
		return actions;
	}

}
